import Vue from 'vue'
import VueRouter from 'vue-router'
// 引入一级导航
import Layout from '@/views/Layout'
import Detail from '@/views/Detail'
import Login from '@/views/Login'
import Register from '@/views/Register'
// 引入二级导航
import Article from '@/views/Article'
import Collect from '@/views/Collect'
import Like from '@/views/Like'
import User from '@/views/User'
Vue.use(VueRouter)

// 删除默认路由，不过我没提示写不出来所以准备写VueRouter里所以全部注释
// const routes = [
// ]

// 设置路由
const router = new VueRouter({
  routes: [
    {
      path: '/',
      component: Layout,
      children: [
        {
          path: 'article',
          component: Article
        },
        {
          path: 'collect',
          component: Collect
        },
        {
          path: 'like',
          component: Like
        },
        {
          path: 'user',
          component: User
        }
      ]
    },
    {
      path: '/detail',
      component: Detail
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/register',
      component: Register
    }
  ]
})

export default router
